Replaced stupid loop implementation with candList in learning algorithm.