Creating code to display results from cursor query