update contains the code to meet the assignment requirements