code for cfg