adding reduce functions