added define-derived-mode suggested by bpalmer