updated scripts and finished plot4