Clip times to zero to avoid negatives
Some tweaks for better detection, suggestion to increase frequency