Renaming the function and few other changes

Hello Scott,

As part of the issue I had opened earlier, I thought of using nothing fancy but to look for an underscore in the name, which works fine for me. Also reduced the script to one single function.