       (previous-line)
       (setq moved-lines (+ 1 moved-lines)))
     (when (> moved-lines 3)
-      (push-mark oldpoint))))
+      (push-mark oldpoint)))
+  (when (and count (> count 1))
+    (zomp-move-up (- count 1))))
+
+(defun zomp-move-until-same-or-less-indent (line-change-func)
+  (let ((initial-indent (save-excursion
+                           (back-to-indentation)
+                           (current-column))))
+    (funcall line-change-func)
+    (while (or (< initial-indent (save-excursion
+                                   (back-to-indentation)
+                                   (current-column)))
+               (looking-at "\s*$"))
+      (funcall line-change-func))))
+
+(defun zomp-next-block (arg)
+  (interactive "P")
+  (zomp-move-until-same-or-less-indent 'next-line))
+
+(defun zomp-prev-block (arg)
+  (interactive "P")
+  (zomp-move-until-same-or-less-indent 'previous-line))
+
 
 (defun zomp-setup ()
   (setq comment-start "//")

      (comment-region start (point))
      )))

(defun zomp-move-up ()
  "Move cursor up one indentation level"
  (interactive)
  ;; skip empty line(s)
  (while (save-excursion
           (beginning-of-line)

  (let ((oldpoint (point))
        (moved-lines 0)
        (column (save-excursion (back-to-indentation) (current-column))))
    (previous-line)
    (while (or
            (>= (progn (back-to-indentation) (current-column)) column)
