depreciation, insurance and utilities. Cannabis costs are affected by various state regulations that limit the sourcing and procurement of cannabis product, which may create fluctuations in gross profit over comparative periods as the regulatory environment changes.
Cost of goods sold are determined from costs related to the cultivation and processing of cannabis and cannabis-derived products as well as the cost of finished goods inventory purchased from third parties.
Cost of goods sold for the three months ended March 31, 2024, was $11,842,888, an increase of $2,274,677 compared to the three months ended March 31, 2023, of $9,568,211.
Gross profit for the three months ended March 31, 2024, was $12,244,427, representing a gross margin of 51%. This is compared to gross profit for the three months ended March 31, 2023, of $9,520,212 or a 50% gross margin. The increase was primarily attributable to increased profit and margin contributions in Maryland driven by the commencement of Maryland adult-use sales on July 1, 2023.
We believe our current production capacity has not been fully realized and we expect future gross profits to increase with revenue growth reflective of higher demand, increased product output and new product development. However, we expect gradual price compression as markets mature, which could place downward pressure on our retail and wholesale gross margins.
Total Expenses
Total expenses other than the cost of goods sold consist of selling costs to support customer relationships, marketing, and branding activities. It also includes a significant investment in the corporate infrastructure required to support ongoing business.
Selling costs generally correlate to revenue. In the short-term as a percentage of sales, we expect selling costs to remain relatively flat. However, as positive regulatory developments in our core markets occur, we expect selling costs as a percentage of sales to decrease via growth in our retail and wholesale channels.
General and administrative expenses also include costs incurred at the corporate offices, primarily related to personnel costs, including salaries, benefits, and other professional service costs, as well as corporate insurance, legal and professional fees associated with being a publicly traded company. We expect general and administrative expenses as a percentage of sales to decrease as we realize revenue growth organically and through positive regulatory developments in our core markets.
Total expenses for the three months ended March 31, 2024, were $7,484,983 a decrease of $1,666,723 compared to total expenses of $9,151,706 for the three months ended March 31, 2023. The decrease in total expenses is primarily attributable to a decrease in salaries and wages and stock-based compensation expense.
Operating Income before Other Income (Expense) and Income Taxes
Operating income before other income (expense) and provision for income taxes for the three months ended March 31, 2024, was $4,759,444 an increase of $4,390,938 compared to operating income of $368,506 for the three months ended March 31, 2023.
Total Other Expense
Total other expense for the three months ended March 31, 2024, was $7,525,904, an increase of $413,428 compared to other expense of $7,112,476 for the three months ended March 31, 2023. This change is primarily attributable to an increased interest expenses partially offset by the gain on warrants held of $1,327,879.