trying to get an efficient buffer working