Unfinished CIR

More complete than before, still not done