Added license information to the code and some additional comments