pass map instead of pointer to map