My homework for comp229.