fixed measurement function