using get (instead of [ ]) to improve the performance of countmap