update process_input() to include global variable