Solution by Niklas