Why do you both print `buf`, and return it?