Add code for charpter 2