renamed mkmatrix to nested_mkvector for mkmatrix work