Formatting & Removed unused #import
Added Logic to separate scanning from matching