diagnostics continued.
rearrange position of functions