helper function for extending output buffer.. just to clean things up a little