Simplified expression for q_x
Fixed HUGE bug in simplified expression for q_x