Turned into a CTE instead of using TEMP Tables