start of set_buf/create_buf