IMO you should create a class that does the computations and generates a list/array of values for yr depreciation, accumulated depreciation, current balance, etc. Front-end will simply have to iterate through the class array to retrieve values rather than a monolithic design where code for computation and population of front-end control are mixed together.