Moved three functions to solverEq and fixed a memleak