displayBuffer some optimizations