added function to solve quadratic equation
implemented new heuristic -- solutions seem better at first glance