add path compress by halving