changed .at()s back to [] accesses
moved creation of sparse H to params
changed "struct Params" to "Params" and removed some redundant parameters from functions taking both outs and params