preprocessing A*