less magic numbers and removed unnecessary trig for faster option