fixed some bugs, created some new ones, still needs some love