Added message printing function.