Starting to code the direction finding functions