implemented plot4