Range detection