Implemented multiagent functionality.