build buffer