adds internal comments, cleans up internal heirarchy