Not working version of the code for @rmhartog