getting closer to the problems with PPU

renamed function variables buffer into buf, so I don't mix them up with
this.buffer.

TODO: the buffer intialization is in wrong place, and everything is
borken because of it.