Added a function to calculate "facing"