added code documentation, checked for pep8, added license