modifying get_heading method