You're absolutely correct! That second one of mine is neither here nor there! The first portion (vl-remove...) is definitely not to be in that function! Yours does exactly what I was thinking of!
Thanks irneb & Lee we often have lots of layouts and when you shuffle them they get out of layout name order I will look at using the code to auto number etc as different people call their layouts different names and would like consistent name as well as order. Like you say always learning.