Fixes to detection code, Completes #14

Comparison and diff functions were bad.
Tolerance was assumed at end, which is wring.
Now maxes out at 50 tolerance
improvements to pixel detection