Added function definition for generating moves