Solution to problem 014