sort lists before changing position
remove debug line