some work on buffers and minor changes