implementing a master key system