Implemented scan-based approach.