Removed some bugs, added some minor functionality