Problem 3 - first attempt. (pair [david karun])