added Q function for two-outcome model
small fixes for multiple outcomes