changes made to include matrix functions