modify moveRight method