Hello Jack,
Thanks for your function package.
I replicated it and I got an error when declaring the bundles as follow
*bundle Qmats = null
*
*bundle b = null
*
*bundle qmats = null*
I change it for
*bundle Qmats
*
*bundle b
*
*bundle qmats*
and works perfectly.
Aefz