A fully working version. Thanks to @xeno-by and @retronym.