Program now filters out bad data (imperfectly). Fixed differences.

Program now filters out bad data (imperfectly). Fixed differences so
that they reset at each new device, and initialize with the first values
of the new device.