add some comment
try to swap the element to its correct place
check duplicate element in vector