added many comments
updated readme and added licence
added a minified version