diff --git a/winio.c b/winio.c
index a1b23f6277dc5761fbbb31db80b50bf1046b237f..784b9734b65237e0061a03489f23ba712d0d2f95 100644
--- a/winio.c
+++ b/winio.c
@@ -528,10 +528,10 @@ inline int get_page_from_virtual(int virtual) {
     int page = 2;
 
     if(virtual <= COLS - 2) return 1;
-    virtual -= (COLS - 1);
+    virtual -= (COLS - 2);
 
     while (virtual > COLS - 2 - 7) {
-	virtual -= (COLS - 1 - 7);
+	virtual -= (COLS - 2 - 7);
 	page++;
     }
 
@@ -539,7 +539,10 @@ inline int get_page_from_virtual(int virtual) {
 }
 
 inline int get_page_start_virtual(int page) {
-    return --page * (COLS - 7);
+    int virtual;
+    virtual = --page * (COLS - 7);
+    if(page) virtual -= 2 * page - 1;
+    return virtual;
 }
 
 inline int get_page_end_virtual(int page) {