fixed bad sqrt