Added messed up check to see if move is legal