Expand on an existing function

Thanks to all for the replies, @s_molinari your one works perfectly as expected. Thank you.