basic function IR implementation NOT DONE