added matrix and subroutines doc