some refactoring of the q1 q2 q3 q4 dict stuff