First pass of Problem 17 (doesn't work yet)