add HW4, p4 need to add counter=64 case