Improved plot4 code, implemented plot5