Added max dark time parameter to stop tracing through the entire dataset
if desired.