minor tweak: explicit const, and sqrtf() instead of sqrt()