add a lot of fetures, fix a lot of bugs