Yes, the first solutions works. I use this code, modified to host an integer and not a word.