debug functions, but still bugs in...
debug complete