better envelope and passing tests