problem7a complete, problem3 complete