Included check for end coordinates when using DIRECTION