get functionality done and duplicate code moved to separate function
changed get function now passing map not *map