fixed a bug in the isCalibrationOver method + fixed bug in the algorithm
minor changes
some improvements to Facebook logic
added a check that prevent counting a peak if it is detected soon after previous peak