Adding bufferSubData function