working code, printbf