introduced function to solve quadratic equations