Implemented automatic scanning.