break some in-line stuff out into functions;  use TextInput
Merge branch 'master' of https://github.com/BarbDean/DiscreteOptimization