Update: code review, formating, package refactoring, license header added