Cleaned up functions, organized along a more logical thought process
Cleaned up functions and data