Put everything in a function to do better variable scoping + reformat