Fixed iterative bugs
Homework 5