implemented mapWithIndex
Merge pull request #381 from jmhofer/mapWithIndex

Implemented `mapWithIndex`