improve "bf" implementation, add test and doc.