replace Dictionary with IntMap