Updated for CMOS type.  Scans not tested yet.