changing the index to support graphs