debugged tan to arctan