after all, there was no error, but rewrote the portfolio value and available cash util functions