Solution by Clive Holloway
