Expanding on the micro chat code from http://www.phptoys.com/product/micro-chat.html