need to check whether creation of basic blocks is correct