A way to map with the index - thanks for advice @samgiles