License.
Minor changes (comments, refactoring).
Minor changes (comments, refactoring).
Minor changes (comments, refactoring).