updated plot script to make animation