Cleaned up and reorganized tex