1. Realize some functions seperately.

But when you merge these functions into a main function, remember to use the same name(data structure) representing the same variable.

  1. Would better design the flow of the functions at the beginning. Add to the main function after testing each sub-function.