Starting to clean up source code and revise comments