Bodman also said Iraq is working on a new " hydrocarbons law " intended to set a legal framework to attract and regulate badly needed investment by foreign oil companies .