adds reduce method