indexpair as separate class