removed the need for atan calculations