Trying to figure out how to condition the returned data