Problem 3 - attempt 2 (pair [david hal karun])