updated script for plots