finish initialization, still need debugging