switched from C++0x to C++11
decoupled indexType from valueType