Commented code. Refactored ScanActor a bit to reuse code.