Finalize glcm function.
Remove debugging code.