persisting the table of q values and testing mode