handle buffer edgecase
2.10.3
pep8