depth first does not work correctly :)