Solution for #26: Reciprocal cycles
also refactoring for some of the previous code