trying to fix atan computing