Regrouped most major functions

Changed some function names. Plan on fixing a lot of this later.