public double[][] createStockLattice(int rows, int cols, double s0,
                                         double up)
    {
        stk_lat = new double[rows][cols];
        //rev_lat = new double[rows][cols];

        for(int i = 0; i <= stk_lat.length; ++i)
        {
            if(i > 0)
            {
                int limit = stk_lat[i-1].length;
                for(int j = i; j < limit; ++j)
                {
                    if(j == i)
                    {
                        stk_lat[i][j] = s0 * Math.pow((up), j);
                    }
                    else
                    {
                        stk_lat[i][j] = (stk_lat[i-1][j-1]) * up;
                    }
                }
            }
            else if(i == 0)
            {
                stk_lat[0][0] = s0;

                for(int k = 1; k < stk_lat.length; ++k)
                {
                    stk_lat[i][k] = S0 * Math.pow((1/up), k);
                }
            }
        }

        return stk_lat;
    }