first implementation of ncdiag and dz evaluation
removed little bug in dz and added documentation