switched buffer to be an array