Created message function, some other fixes