Near the bottom of this file, we have a block of code that looks almost like your new function.

Should be able to use your new function with it.

Line 269 of this file, is where it starts.