@graeme-f : I have updated the code to what you suggested, please review