Based on an idea by @degree_kaapi, @saffrontrail and @krishashok