third problem of chapter 4, unclean on the first 2 parts.. need to refactor =P