Cleaned up the code, got rid of unnecessary stuff, and eliminated warnings.