add initial buffer code