Removed dependence on diagCount