Implements a crude version of IDA*