Direction finding function done