First working version of task 3