Added function BufToStr