Re-ordered the functions into sections based on what they do.