Added global variable for path.
Added multiple functions for non-interactive mode.