Adding reduce method