$q is used to index the data array @d to select which character is printed. How is $q computed?