fixed data collection thread and added a little filtering on possible values.
Merge remote-tracking branch 'origin/phase2' into phase2