now use constants for Stream IDs and also improved the comparison of descending terms and counts