remove the client debug print
turn struct Buffer into a class

Fix the memery leak