Moved input code to separate file