Added notes and beautified.