Added Ranging-logic