Updated for code task 3 & 4