Moved the interactive_shell function. Updated version.