added gmatrix.jl (tested)