Added messaging functionality. Can be improved a bit.