Simple Cycles speed up

Speeding up simple_cycles (issue 604 / trac 613)