Minor fixes, better algorithm for avg value
Merge branch 'master' of https://github.com/OHSystem/ohsystem