Some work on passing hash-map to functions