Using Maps as data structures and Functions