Convert this problem to a non-circular pattern matching problem.