Manually entered code for Chapter 6 to understand it better.