Final version of task1