Improved task C apply in task 7