Task2 optimization