add save and load.but some bugs left