implemented plot3 and generated output.