Shuffling Main Code away from functions