Homework #3 bug fixing.