Problem 27, version 2
Problem 27, v3