Improving a Hierarchical Evolutionary Algorithm with Applications in Optimization and Machine Learning