add JS code to calculate balance sheet