You are correct, this is much simpler. I am using the proposed form in my code and have deleted this function accordingly.