connect end with head then break the list in the appropriate position