Added buffer function