implemented function for finding optimal strafe angle