Added a case to handle no movement when the starting and ending coordinates are the same