Refactored/cleaned reducer.py & clustering.py