added flowchart from fred