That explains what the functions actually do, but it doesn't solve your problem. Your problem is impossible to solve because "doesn't work" is not an accurate enough description of the problem to be able to help. What is actually happening that shouldn't be happening? What is not happening that should be happening? Have you tried any debugging by stepping through your program with SST?