slight rearrangement of atc function