Implemented a first working version that retrieves RI from input