removed some debug prints - there is nothing wrong with edge detection scheme, but if the interval is too short the averages are off