Modified the arctan function to be correct mathematically