added problem19
refactored program a bit