modified compile loop
compact table