making depth tree search for atoms