renamed "world" to "buffer" and imported CellMode code