@Timeless000729 there are still some missing definitions, like grad and Uncertainties .
Then where does HashMap comes from? You should include an open statement and possibly an #r "nuget: .. if it comes from a library. You say diffs is a list of floats, ok then include it. You don't need the exact definition if it's not relevant, but at least something that makes it compile.
If I pick your code, put it in a script and it doesn't compile, not because of the problem you mention but because of a missing definition, how can I possibly help you?