Flattening Binray Tree