Moved Adv & Ret tags from global variables to local for MainTask
Added Ret and Adv functions