add mag_heading version but not workable right now, and separated into modules