Updated equation solver