Updates to the distance calculation and basic code for calculating speed