worked on linv and rinv