Getting closer, only need correction on r
Envelope generator is working on uno