added temp table, moved truncate to step 3