Revert "Revert "Cleaned up code (DO NOT MODIFY, THIS IS IN PROGRESS)""

This reverts commit 09fd783ba918b5bc88fcc7235b8d3cd4ab71d7fb.