Code Cleanup

-Cleaned up various parts of the code.