Add unittest for generateMessage()
rewrite generateRandom()

cleaner code for generateRandom()