Code restructures and task 2