Implementing HW1 learning.