CS homework for 2340