buffer.lua

still many errors. need to be rewrite.