Added some logic to making moves.
Added Some logic to making moves.