use buffers instead of realloc-ed string. makes code shorter.