split the adding mean and the tidy process from the main function, adding a reference to the R cookbook site