changed how queries run to be better