changed map::operator[] references to map::at -- raises exception on key_error, and doesn't fail silently