{-# htermination index :: (Int,Int) -> Int -> Int #-}