Work in progress, need to check it works fine and replicates what was suggested