Added method reduce to Sequence class