fixed some bugs, more to come