Filled in isvalidmove method