def build_block(chanjo_db, interval_group):
  """Create a new block and add it to the current session.

  Args:
    chanjo_db (Store): Chanjo store connected to an existing database
    interval_group (list): group of related database intervals

  Returns:
    tuple: superblock id, new database block
  """
  block_id, some_interval, superblock_id = interval_group[0]

  # create a brand new block
  new_block = chanjo_db.create(
    'block',
    block_id=block_id,
    contig=some_interval.contig,
    start=min([payload[1].start for payload in interval_group]),
    end=max([payload[1].end for payload in interval_group]),
    strand=some_interval.strand,
    superblock_id=superblock_id
  )

  # add the new block to the current session
  chanjo_db.add(new_block)

  # relate the intervals to the block
  new_block.intervals = [interval for _, interval, _ in interval_group]

  return superblock_id, new_block