add serialized function

- modified bufferfn to extract first value