global ak search. work in all cases, might not be ideal.
Final (hopefully) timestepping scheme.
global error