> I am working on a more general solution, extending to other functions. Sounds good, thanks!