Implemented functions to summarize and tidy data