runKCM (WriteResult blocks elems arr) ids km = (((),ids',km'),prg ++ (writeResult res blocks elems)) -- CHEATING
  where ((res,ids',km'),prg) = runKCM arr ids km 
runKCM (WriteResult blocks elems arr) ids km = (((),ids',km'),prg ++ (writeResult res blocks elems)) -- CHEATING
  where ((res,ids',km'),prg) = runKCM arr ids km 
runKCM (WriteResult blocks elems arr) ids km = (((),ids',km'),prg ++ (writeResult res blocks elems)) -- CHEATING
  where ((res,ids',km'),prg) = runKCM arr ids km 