added post grouping logic