better license, fix bugs and typos