changes to moveEach function to limit more code