Added license information and cleaned

Cleaned small portions of the code, and added the license information.