added email export option
made kg-mode global