Fixed bugs. Version fot part 1 of HW4.