modify moveUp function