Corrected some of the midpoint logic and established a method for calculating the absolute distance between two points