Refactored code (utils class). Implemented hierarchic genetic algorithm.