Finished basic functionality for chat