Updated and refactored code with all test agents, some optimization, and resolved some previous issues.