Use reduce from functools