write.bc - function