Could you perhaps move this buffer into apply() or better yet make it part of the tailrec method?