got rid of atan2, should be faster?