modified get_angle() function again