Added IR code. Working version !