Refactored - licenses and comments added