Solution by Adam Russell
