add path compression