Finished addkey functionality.