Removed getMatrix function as not needed