added license and cleaned up a bit