An implementation using cyclow. It uses Iterator (cyclic) from graflow, so you don't have to care about pos.
pos