Code used in range finder tool