Some minor changes. Still working out how the buffer works.