changed the data structure to support security rules