Clearing D1 and checking end of category reached using word size rather than long