make use of hypot(), better sqrt()