Solution by Jeremy Carman
