Solution to #16.