Changes stub to matrix functions