added parsing function to q_val program