Cleaned up unused code, comments, and whitespace.