I pride myself on being pretty financially savvy—after all, I’m a personal finance writer. I’m well versed in best practices for saving and spending, the ins and outs of HSAs and IRAs, and the basics of investing.

But when it came time to buy my first house, I had to put my ego aside: I was way out of my depth as I navigated the world of mortgages, closing costs, and escrow.

While all of the Budgeting 101 basics still apply to purchasing a home—top tip: Don’t buy anything you can’t afford!—some aspects of the process can come as a surprise to first-time buyers.

Gearing up to buy a house of your own? Get acquainted with these five lessons that I learned the hard way before you start shopping. Then, you’ll be ahead of the curve when it comes time to make an offer on your ideal home.

1. Don’t be fooled by your mortgage pre-approval amount

One of the first steps on the road to homeownership was requesting a mortgage pre-approval letter from a mortgage lender. I was shocked when my husband and I received a letter with a much higher number than we had ever considered spending.

The lender thought we could afford a house that cost how much?!

I quickly learned that a pre-approval letter is just assurance from a lender that the buyer is in good financial standing to take on a mortgage of a certain size. Lenders evaluate your financial history to come up with a pre-approval amount. Don’t confuse that number, though, with your actual budget for buying a house. In other words, just because you’re pre-approved for up to, say, $300,000, doesn’t mean a $300,000 mortgage will fit in your budget.

For us, we knew we didn’t want to stretch ourselves thin with a heftier mortgage, even if we were technically approved to take one out.

2. Closing costs can add up—and be complicated

Closing costs include out-of-pocket expenses like title insurance, notary fees, and the cost of the deed—and they can add up quickly. So when we made an offer on our house, we decided to ask for a credit from the sellers toward our closing costs—a common practice in which, typically, the seller advances an amount in cash that’s then tacked on to the purchase price. But I was surprised when our Realtor® urged us not to ask for too much from the sellers at closing.

“Some loan programs only allow a certain percentage of the sale price to given to the buyer as a credit,” says Joe DiRosa, a real estate agent with RealtyTopia in Pennsylvania.

That means that if you’re offering $200,000 for a house and your lender only allows you to accept 2% in closing costs, you shouldn’t ask for $5,000—that would be $1,000 down the drain, since you can only accept up to $4,000 in credit. This type of limit on closing cost credits is especially common with government loans, including FHAs, DiRosa notes.

3. PMI isn’t actually the devil

Private mortgage insurance—PMI for short—is at once a blessing and a curse. Lenders typically require it of buyers who are putting down less than 20% on their mortgage. This puts homeownership within reach for more people, but it also means an additional monthly payment that doesn’t add to the new owner’s equity.

For that reason, PMI sometimes gets a bad rap—better to shell out the necessary down payment cash (if you can) than waste your money on insurance, right? But in some cases, it’s in your best interest to put less money down and pay the PMI.

That was the case for my husband and me. We decided to hold on to some of the cash we would have put toward a 20% down payment and use that money to renovate our home and pay off other debts with higher interest rates. Our PMI payment has been manageable—we pay about $75 a month—and it’s worth it to keep our money in our bank account, where we can use it for projects like replacing the roof, renovating bathrooms, and creating a master suite.

4. You might have to make escrow payments

“Escrow” was a foreign word to me before buying a house. (Confession: I still picture a crow every time I hear it.)

Because we took out a loan with PMI, we were required to pay into an escrow account for our property taxes and home insurance. Escrow simply refers to the separate account where that money is held; basically, our lender sets aside the money for taxes and insurance, which acts as a safety net to ensure that we sock away enough money for those expenses.

While it’s nice to know we’re saving enough for taxes and insurance by paying into escrow, it’s also frustrating for control freaks like my husband and me, who would rather manage our money ourselves—preferably by putting that cash into a high-yield savings account where it can accrue interest. We’re looking forward to canceling our escrow payments as soon as we’ve built up enough equity in our home to remove PMI.

5. You need to budget for surprises (and your own mistakes)

During our home inspection, the inspector ran the dishwasher to make sure it worked—all good. Then, the day after we moved in, we loaded the dishwasher, hit “Start”—and it was dead. After flicking the electrical circuits on and off to no avail, we finally accepted that we would need to replace the dishwasher sooner than we had bargained for.

Several hundred dollars later, we learned that dishwashers are required to have their own wall switch, per local code. It turned out the old dishwasher wasn’t broken after all—the switch was just turned off.

All we could do was laugh, too slap-happy and exhausted from renovating to beat ourselves up much about the mistake. At least we planned to replace the dishwasher sooner or later, and we had enough savings to endure the blow. But the incident was a reminder that costly surprises (and stupid mistakes) are inevitable when you’re new to homeownership—and even when you’re not.