got post-processing to work with realloc