working wordict code