Figure 1:

Block diagram of entire flow.