clean the code and add folders tree feature.

clean the code and add folders tree feature.

add new global variable(bad smell)... and forget to delete g_Data.