added indexBy to example code