Addded the code for the assignment