added functionality to properly compute p_ug for all users respectively