Includes added editor folds for easy viewing and rearranged initializations and functions