implement buffer structs