// recursive function to calculate interest
        public double RecursiveCalc(DateTime cutOffDate, double rate, Transaction[] transactions,
            double balance, double acquiredInterest)
        {
            if (!transactions.Any()) return 0;
            Transaction trx = transactions[0];
            if (transactions.Length == 1)
            {
                int days = (cutOffDate - trx.Date).Days;
                acquiredInterest += (trx.Amount+balance).DailyInterest(rate, days);
                return acquiredInterest;
            }
            else
            {
                int days = (transactions[1].Date - transactions[0].Date).Days;
                balance += transactions[0].Amount;
                acquiredInterest=acquiredInterest + (balance.DailyInterest(rate, days));
                return RecursiveCalc(cutOffDate, rate, transactions.Skip(1).ToArray(), balance, acquiredInterest);

            }
        }