Replace amap with mapslices in cor