Cyclic fix

Added subsequence length option, fixed bugs in output and refactored a bit to keep within style guidelines.