Solves part 1 of metomi/rose#86.