[cg_level_connected] expanding an array one-by-one with LHS-realloc is pretty inefficient. Switched to doubling size of the growing array