modify buffer of data structure
add selection test
refactoring buffer