Created by EK, flowchart for data handling