Added modifications to main query