Fixed bugs, homework 6 - part 1