Giving ThreeMap as an argument to another function