ap scan function working, improvement in progress
refactor ap_scan
rename file