Program outputs user input before doing anything else