First commit with offset and buffer functions together