new code for moving pages