added some comments and java doc
implemented search method in Agent.java