Replaced MapBufferSlice with the more general Slice function