+ working solution by Christian Sauer