more work on move_snakes function