Changed if statement in determine matrix sizes to less than