I'm sorry, the patch I sent needed a function that I assumed was built-in. Here is the corrected patch.