Modifying the bufferdata function.