finalized the dept-first labyrinth