having problems with the sort buffer