improved scrambler to prevent generating moves that undo previous moves