adding keys and instances