Figure 1: Flow Chart of Function.