fixing first order solver