Finally finished chapter 8. everything works. static vars have been implemented.