add indexes, counts