Update 2.md

- Minor editing for readability.
- changing sample code to follow conventions used in this book.
Merge pull request #19 from kr15to/patch-2

Update 2.md