Removed global variables,changed user input method