Began breaking up large functions and fixing memory leaks.