write: supported more complicated cycles