It got more complicated when I tried to add while loops and functions.  Not done.