implemented link lengths all over