Get p_main to the point where it compiles and works when n == 1.