numbered some sub chapters and modified some code