working code for all parts!
plotting code for all parts