modified to properly accept arg for number of agents