created a seperate method for creating the preBuffer