still one problem left, read_buf(..) is not implemented correctly