created the function for the assignment