added angleToBeacon function