changed index to map