reorganized the code a little
centered messages