added functions split and get_submatrix