Adding Pattern Recognition code, HW 3 and 4