added logic for moving players