Homework 6 for CS course complete