Calculating Distance and Position