implemented generic form of getMIDASindex