Add license
Fixed bugs, changed key names