added 'addRollingArray' function and test