Commiting changes to q_max (not finished)