bug fixes for hw4 part1