I've sectioned off the different methods used.  I also took off the return value for the ending functions turning them into procedures for the flowchart.