add licence and some small changes