implemented buffer struct and parallel buffers