added license, fixed a few warnings