refactored main() to a single primary loop

added getSIOption() to header.  single primary
for loop now queries getSIOption() rather than
relying on original if/then/else logic with
duplicated for loops.