reworking indexing bug!