 (progn
   (add-to-list 'auto-mode-alist '("\\.lcad\\'" . lcad-mode)))
 
+(defvar lcad-indent-offset 1)
+
 ;; lcad specific offsets here
-;(put 'aref 'lcad-indent-function 1)
-;(put 'block 'lcad-indent-function 1)
-;(put 'cond 'lcad-indent-function 1)
-;(put 'def 'lcad-indent-function 1)
-;(put 'for 'lcad-indent-function 1)
-;(put 'if 'lcad-indent-function 1)
-;(put 'import 'lcad-indent-function 1)
-;(put 'list 'lcad-indent-function 1)
-;(put 'mirror 'lcad-indent-function 1)
-;(put 'part 'lcad-indent-function 1)
-;(put 'print 'lcad-indent-function 1)
-;(put 'rotate 'lcad-indent-function 1)
-;(put 'set 'lcad-indent-function 1)
-;(put 'translate 'lcad-indent-function 1)
-;(put 'while 'lcad-indent-function 1)
+(put 'def 'lcad-indent-function 'defun)
+(put 'for 'lcad-indent-function 1)
+(put 'mirror 'lcad-indent-function 1)
+(put 'rotate 'lcad-indent-function 1)
+(put 'translate 'lcad-indent-function 1)
+(put 'while 'lcad-indent-function 1)
 
 (defun lcad-indent-function (indent-point state)
+  (let ((temp (lcad-indent-function-try1 indent-point state)))
+    (print "indent")
+    (print temp)
+    temp))
+
+(defun lcad-indent-function-try1 (indent-point state)
   (let ((normal-indent (current-column)))
     (goto-char (1+ (elt state 1)))
     (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)

			 (buffer-file-name) " "
			 (file-name-sans-extension (buffer-file-name)) ".dat")))

;(define-derived-mode lcad-mode lisp-mode 
(define-derived-mode lcad-mode c-mode 
  "lcad-mode is a major mode for editing the lcad language."
  :syntax-table lcad-syntax-table
  (setq font-lock-defaults '(lcad-keywords))
  (setq mode-name "lcad")
  ;(setq lisp-indent-function 'lcad-indent-function)

  (local-set-key [f5] 'compile)
  (define-key lcad-mode-map [remap comment-dwim] 'lcad-comment-dwim))

(provide 'lcad-mode)

;
; The MIT License

              ((integerp method)
               (lisp-indent-specform method state
                                     indent-point normal-indent))
	      (method
               (funcall method indent-point state)))))))

(defun compile ()
