input program works
several adjustments due to PEP 8