added code for selecting a move