Assignment 5: Task 4 implemented.