plot 3 and 4 updated with legend