Upgrade .q query to show logic behind the result