replaced the counter var for envelope tracking