Major refactoring: added license and example file