Added a random query method