updated teh code for Assignmebt 2