updated some pnl related code