Added licence, major code update