Added code for the 8-th part.