Anyone who’s ever relied on public transportation knows that waiting can be the worst part. Even with apps that provide arrival estimates, riders can still find themselves at a loss—straining their eyes in hopes of seeing train lights in the distance, or furiously checking phones while wondering what on earth is holding up a delayed bus.

But a new study suggests that the feelings of frustration associated with waiting can differ significantly depending on how gross a station is, and that simple improvements could make that maddening wait time seem much shorter.

The paper’s authors, Marina Lagune-Reutler, Andrew Guthrie, Yingling Fan, and David Levinson, of the University of Minnesota, collected over 800 survey responses at 36 transit stops around the Twin Cities region, recording both how long the wait times were and how long the riders perceived them to be.

In general, they found that riders typically overestimate shorter wait times and underestimate longer wait times (i.e. riders who waited for about two minutes felt like they’d waited for five, but riders who waited for 10 minutes felt like they’d only stood around for nine.)

But that general principle was beholden to some pretty powerful external factors: Riders who waited at stops where there was lots of pollution and traffic significantly overestimated their wait times. The effect was especially pronounced for those who were waiting for longer than five minutes, with those who waited for their rides for 10 minutes in areas that they felt were noisier and dirtier reporting that they had waited for over 12 minutes. Researchers also found a simple mitigating factor: trees. According to the data, the presence of mature trees helped make wait times feel less painful, for both short and long waits, and even in areas where other negative factors were present.