Added support to automatically generate CFGs