Sorry if this question has already been answered, I am having trouble discerning the error in the following code snippet