Fixed compiler errors and abstracted the scan threading in DA