add code for Assignment4