Updates to algorithm

Updated track algorithm to prevent range errors on arguments to asin
Formatting changes