added some function in main.js, and start to implenment some basic function