Implemented method to solve quadratic equations