Finish a5p4.
Change transition counting to account for ranges.