updated to support replica sets and improve front page performance with aggregate instead of group.