add query function. Need to add predict functionality