Implementing equation solver