Improved creation of homology cycle. Simplified the code.