Creating A Tree Structure In Python