Providing solution to the last task.