Portfolio code generation seems to work!
Portfolio example works; runs really slowly compared to paper code.