Implemented reduce