public double[][] createLattice(int rows, int cols, double rate,
            double up, double down, double q)
    {
        double[][] lattice = new double[rows][cols];

        for(int row = 0; row < rows; ++row)
        {
            for(int col = 0; col < cols; ++col)
            {
                /*
                 * Generate the first column and first row with the value
                 * of the 'rate' constant
                 */
                if(row == 0 && col == 0)
                {
                    lattice[0][0] = rate;
                }
                /*
                 * Generate data for all columns > 0 in row 0
                 */
                else if(row == 0 && col != 0)
                {
                    lattice[row][col] = down * lattice[row][col - 1];

                }
                /*
                 * Where the row number is equal to the column number, multiply
                 * 'up' constant times the value in lattice[row-1][column-1].
                 * All other values in this row will be dealt with in the next
                 * conditional.
                 */
                else if(row == col)
                {
                    lattice[row][col] = up * lattice[row - 1][col - 1];
                }
                /*
                 * Generate data for all columns greater than the row number.
                 * This will only work where the values have already been
                 * generated where row number equal column number as set forth
                 * in the preceding conditional.
                 */
                else if(row < col)
                {
                    lattice[row][col] = up * lattice[row - 1][col - 1];
                }

            }

        }

        return lattice;

    }