Introduced Chapter 2 and written the algorithm