finished implementing trivial buffer