remove illegal moves