boggle algo elegantly, sometimes golfed