Update notes.md.
Improve code formatting and add some comments.