added input sanitization, made sums display configurable