diversity calculations