Redid completely using tornado iostream