Move SizeComparator to a private class within Matrix