added additional group statements to queries for metric comparison