cleaned up cycle interactions
implemented much of the encoding and decoding of cycles