k&r; exercise 1.17 - better naming