Arranged the function calls to match the assignment needs