complete hw1 solutions, needs editing