Moving diag code