solveStep now only impure function.