Changed portfolioImpl logic to update cash.