added functions to select random hive and random hive close to the current position