reworked program.py to be more flexible