clean up move generation function