Code a little more stable, but there are still serious numerical issues in the Q-solver. Need to understand what's going on better