add functionality to use multiple indexes