plot 3 and required refactoring