added code to print the list of moved positions