Generic reducer.py file for both large and small