Massive renaming to meaningful label and function names. Cleaned up formatting.