fix pkl bug and add reduction
Merge pull request #5 from jasonwbw/cython

fix pkl bug and add reduction