Agent Search Code Finished