Updated example with CTE tweak