working on debugging why diag=2 is hit before diag=0