added licence and comments