Merge pull request #2 from DomenicP/master

Merging changes from DomenicP's version.
Added license to code