implemented home cycle and refactored some cssg