fixed some bugs, should work as intended