Added seperate agent file.
Changed the key add to check if the current key to add, is already in the agent.