added license and some clean up