changed agents from array to dict