cleaned, added solve_right()