pulled sum_p_init out of context