Fixed some bugs, added some ideas