cumulative = {
const tmp = Array(max_years);
tmp[0] = {year: 1, input: yearly_invest, cum_input: yearly_invest, value: yearly_invest};
for (let i = 1; i < max_years; i++) {
const yearly_invest_w_cutoff = i >= invest_years ? 0 : yearly_invest;
tmp[i] = {year: i+1, input: yearly_invest_w_cutoff, cum_input: tmp[i-1].cum_input + yearly_invest_w_cutoff, value: +(tmp[i-1].value * (1 + interest/100) + yearly_invest_w_cutoff).toFixed(0)};
;
}
return tmp
}