The assignment code for the required functions has been added