Modified script containing solution for Assignment 2