added new functions to do querry