Machine Learning HW #2 solution