additional changes to buffer => still untested