replaced IndexHash by C++11 code with lambdas. closes #73