Worked on chapter 6 problems

Did most of chapter 6 problems, still need to write two functions and
check the answers.