update code

still need to functionalize the IR parts