Fixed some bugs, added print statements