Added attitude reference code