Completed most exercises from chapter 4