solveEquation() method added