revised threshhold and ignoring first and last 10 frames