add pybn code with documentation