Finally all working after chapter 15 exercise.