Finish implementing the function no.5.