Added changes for only deleting last position