added license + nicer code formatting