Redone String function

redid string function to better match flowchart. Removed extra commented
code. Added final outputs, and rearranged a few things.