Start of the CreateBuffer code