WIP: continued implementing reduce