Finished adding functions for non-interactive mode.