diff --git a/datok.go b/datok.go
index ef3667b..4a50d2c 100644
--- a/datok.go
+++ b/datok.go
@@ -743,6 +743,29 @@
 	return string(out)
 }
 
+// Show the current state of the buffer,
+// for testing puroses
+func showBufferNew2(buffer []rune, buffo int, bufft int, buffc int, buffi int) string {
+	out := make([]rune, 0, 1024)
+	for x := 0; x < len(buffer); x++ {
+		if buffo == x {
+			out = append(out, '>')
+		}
+		if buffi == x {
+			out = append(out, '^')
+		}
+		if bufft == x {
+			out = append(out, '|')
+		}
+		if buffc == x {
+			out = append(out, '[', buffer[x], ']')
+		} else {
+			out = append(out, buffer[x])
+		}
+	}
+	return string(out)
+}
+
 // Transduce input to ouutput
 func (dat *DaTokenizer) Transduce(r io.Reader, w io.Writer) bool {
 	return dat.TransduceTokenWriter(r, NewTokenWriter(w, SIMPLE))
diff --git a/matrix.go b/matrix.go
index ecb22be..8448474 100644
--- a/matrix.go
+++ b/matrix.go
@@ -11,6 +11,7 @@
 const (
 	MAMAGIC = "MATOK"
 	EOT     = 4
+	BUFSIZE = 4096
 )
 
 type MatrixTokenizer struct {
@@ -338,13 +339,14 @@
 	// Remember if a text end was already set
 	textEnd := false
 
-	buffer := make([]rune, 1024)
+	buffer := make([]rune, BUFSIZE)
+	buffo := 0 // Buffer absolute offset
 	bufft := 0 // Buffer token offset
 	buffc := 0 // Buffer current symbol
 	buffi := 0 // Buffer length
 
 	// The buffer is organized as follows:
-	// [   t[....c..]..i]
+	// ...o[...t[....c..]..i]
 
 	reader := bufio.NewReader(r)
 	defer w.Flush()
@@ -386,7 +388,7 @@
 			char = buffer[buffc]
 
 			if DEBUG {
-				log.Println("Current char", string(char), int(char), showBufferNew(buffer, bufft, buffc, buffi))
+				log.Println("Current char", string(char), int(char), showBufferNew2(buffer, buffo, bufft, buffc, buffi))
 			}
 
 			eot = false
@@ -487,7 +489,7 @@
 			// Transition does not produce a character
 			if buffc-bufft == 1 && (t&FIRSTBIT) != 0 {
 				if DEBUG {
-					log.Println("Nontoken forward", showBufferNew(buffer, bufft, buffc, buffi))
+					log.Println("Nontoken forward", showBufferNew2(buffer, buffo, bufft, buffc, buffi))
 				}
 				bufft++
 				// rewindBuffer = true
@@ -497,22 +499,23 @@
 			// Transition marks the end of a token - so flush the buffer
 			if buffc-bufft > 0 {
 				if DEBUG {
-					log.Println("-> Flush buffer: [", string(buffer[bufft:buffc]), "]", showBufferNew(buffer, bufft, buffc, buffi))
+					log.Println("-> Buffer values", buffo, bufft, buffc, buffi, epsilonOffset)
+					log.Println("-> Flush buffer: [", string(buffer[bufft:buffc]), "]", showBufferNew2(buffer, buffo, bufft, buffc, buffi))
 				}
-				w.Token(bufft, buffer[:buffc])
+				w.Token(bufft-buffo, buffer[buffo:buffc])
 				rewindBuffer = true
 				sentenceEnd = false
 				textEnd = false
 			} else {
 				sentenceEnd = true
-				w.SentenceEnd(buffc)
+				w.SentenceEnd(buffc - buffo)
 			}
 		}
 
 		if eot {
 			eot = false
 			textEnd = true
-			w.TextEnd(buffc)
+			w.TextEnd(buffc - buffo)
 			rewindBuffer = true
 			if DEBUG {
 				log.Println("END OF TEXT")
@@ -522,26 +525,35 @@
 		// Rewind the buffer if necessary
 		if rewindBuffer {
 
-			if DEBUG {
-				log.Println("-> Rewind buffer", bufft, buffc, buffi, epsilonOffset)
-			}
+			if buffo < (BUFSIZE - 128) {
+				buffo = buffc
+				bufft = buffc
+				epsilonOffset = 0
+				epsilonState = 0
+			} else {
 
-			// TODO: Better as a ring buffer
-			// buffer = buffer[buffc:] !slower
-			for x, i := range buffer[buffc:buffi] {
-				buffer[x] = i
-			}
+				if DEBUG {
+					log.Println("-> Rewind buffer", buffo, bufft, buffc, buffi, epsilonOffset)
+				}
 
-			buffi -= buffc
-			// epsilonOffset -= buffo
-			epsilonOffset = 0
-			epsilonState = 0
+				// TODO: Better as a ring buffer
+				// buffer = buffer[buffc:] !slower
+				for x, i := range buffer[buffc:buffi] {
+					buffer[x] = i
+				}
 
-			buffc = 0
-			bufft = 0
+				buffo = 0
 
-			if DEBUG {
-				log.Println("Remaining:", showBufferNew(buffer, bufft, buffc, buffi))
+				buffi -= buffc
+				epsilonOffset = 0
+				epsilonState = 0
+
+				buffc = 0
+				bufft = 0
+
+				if DEBUG {
+					log.Println("Remaining:", showBufferNew2(buffer, buffo, bufft, buffc, buffi))
+				}
 			}
 		}
 
@@ -580,7 +592,7 @@
 		epsilonState = 0 // reset
 		buffc = epsilonOffset
 		if DEBUG {
-			log.Println("Get from epsilon stack and set buffo!", showBufferNew(buffer, bufft, buffc, buffi))
+			log.Println("Get from epsilon stack and set buffc!", showBufferNew2(buffer, buffo, bufft, buffc, buffi))
 		}
 		goto PARSECHARM
 	}
@@ -589,14 +601,14 @@
 	// sentence split was reached. This may be controversial and therefore
 	// optional via parameter.
 	if !sentenceEnd {
-		w.SentenceEnd(buffc)
+		w.SentenceEnd(buffc - buffo)
 		if DEBUG {
 			log.Println("Sentence end")
 		}
 	}
 
 	if !textEnd {
-		w.TextEnd(buffc)
+		w.TextEnd(buffc - buffo)
 
 		if DEBUG {
 			log.Println("Text end")
