extracted methods equalCoordinates printDistance