Functions for Processing Scans