add update functions to buffer.c/h