Added skew detection.  Needs cleaning.