Solution by Lars Balker
