fix some bugs, basic functions
it works