added function which returns the previous state of every agent