made a shitty query function