Implement envelopes in principle.  The rates are wrong though.
Fix overflow error in envelope rates