fixed some bugs and tweaked word hiding algorithm