Code added for varying threshold vs expression diversity