For randomwalk : remove union operations, replace distinct operations with sets