Updated second code example