apply reduce