added envelope tracking stuff back in