Write calculations to array