added 'e' option
moved functions to cmdInterpreter
added some comments