Improved code legibility

Added notes into code.