added indexing to each entity