accumulate used instead of storing in map