some refactorings
fixed display of pdf
q_min and q_max are now working