It seems you need to take more time to study the code in admin.sma (where you copied some of this stuff) to see what is actually going on there. Once you figure out exactly what is going on then you should be able to figure it out (assuming I have any clue what in the world you are trying to do).