public function fixTop() { for ($address = 0; !$this->storage->ends(); $address++) { $node = $this->read($address); $parent = $this->parent($node); if ($parent < 0) { $this->topAddress = $address; return true; } } return false; }