started implementing the valid moves function