Corrected the logic for coordinate generation when keyframes are only seperated by a vertical distance (no change in the horizontal coordinate)