added cleanup of unused temp regs