Commenting code
Minor refactoring