Replace array access with genop
Remove unused variable