           (insert "  ; [=" date-string "]")))))))
 
 (defun ledger-mode-remove-extra-lines ()
-  (goto-char (point-min))
+  "Get rid of multiple empty lines."
+	(goto-char (point-min))
   (while (re-search-forward "\n\n\\(\n\\)+" nil t)
     (replace-match "\n\n")))
 
 (defun ledger-mode-clean-buffer ()
-  "indent, remove multiple linfe feeds and sort the buffer"
+  "Indent, remove multiple linfe feeds and sort the buffer."
   (interactive)
 	(untabify (point-min) (point-max))
   (ledger-sort-buffer)

      (message balance))))

(defun ledger-magic-tab (&optional interactively)
  "Decide what to with with <TAB>.
Can indent, complete or align depending on context."
  (interactive "p")
  (if (= (point) (line-beginning-position))

      (save-restriction
        (narrow-to-region (point-at-bol) (point-at-eol))
        (cond
         ((eq 'xact context)
          (beginning-of-line)
          (re-search-forward ledger-iso-date-regexp)
          (when (= (char-after) ?=)
