add check file existence function
move mergeAC arguments definition back
minor changes