fix missing headers for f_i and g_i.
use curly brackets ({}) to properly gropu subscripts for plotting with matplotlib.
WIP: plot f, g, P, and W.