Used var as storage file name
Improved get_messages output template
New messages are first in output