Implements task2