Cleaned up all of the code