Update algorithm to use byte buffers