Removed unnecessary variable Busy. You can exit a loop with 'return' or 'break'
Made terminal-related code into a module