Update netdist function