Changed vector to map

for access with keys instead of indices