added comments and a modified version of the plotting function for different set of panels