changed reduce to minute function