Added dynamic range checking, may need to lower threshold.