implements the DHT monad