Solution by Matt Latusek.
