Hacked to work with the latest build. Need to take a closer look at Buffer, as it's possible I can do borrowing rather than copying all over the shop