fixed some bugs, need more to do