update to M4, plot2d changes