modified matrix values from int to short; Reduced execution time