Improved guessing, fixed some bugs