Solves quadratic equations