second homework for foundations of cs class