destroying temp variables done partially
merge