Final version for task3