have to rework the malloc and realloc on simplebigram so that we do not get segfaults