add makeTree and getListSize
merged global.h and .c