Refactor, add cumulative, tests work