revision to portfolio.py