Changed rotation function to use magnetic heading