updated script for assignment 4