Modify code to work with the survey