cfg fully implemented