Made it so that all the separate tidying functions are called by one central TidyUp function that guesses which one is appropriate.