Updated code so it now works in companion with StudentMatrix.