stats functions: added mode
Merge pull request #2635 from fabriziofortino/develop

stats functions: added mode