re-arrange buffer layout