chat engine from tutorial, with some postion code