LIS fixed. Silly mistake: i vs j typo