Remove average from heading data and add debugging code