merged scan stuff into ScanFragment.java