moved NullSolve to its own function