keep balance of investment-output

#code Codes