added license
fixes #9 and #12
resolves #1
general QA, added comments