Refactored and added plot4