Supplementary code for Task 1