Whether you’re planning on riding 40 miles or you’re simply going for a quick ride around the block, it’s always a good idea to stretch before you cycle. Stretching warms up and loosens your muscles, which can help to prevent injuries and boost your overall performance. Similarly, once you’re done riding, stretching can help to break down lactic acid, prevent your muscles from tightening up and improve your flexibility. Here are a few pre- and post- cycling stretches that you can try for yourself.

Pre-cycling stretches

High Knees: The high knees stretch is a particularly effective one, especially for cyclists. The best warm-up stretches mimic the movement that you’re about to do (in this case, cycling), and according to Livestrong.com, the act of bringing your knees up while standing in place is pretty similar to the repeated motion of cycling. So, before you start riding, stand in one spot, and lift each knee up as high as you can. You should gradually increase your speed, sort of hopping in place, while still bringing your knees up high.

Butt Kicks: This stretch is pretty similar to the high knees stretch. But this particular stretch helps to engage your hip flexors and quads prior to your ride—in other words, it’ll open up your hips and the front of your legs. So make sure to stand in place, with your upper body rigid, and bend each knee one at a time (once again, sort of hopping quickly while standing in one spot), bringing your heel up against your buttocks. You don’t have to kick all that hard—it’s more about the act of moving your legs and knees repeatedly.

Heel-Toe Walk: Your lower legs do plenty of work when you’re riding, so make sure to stretch them out too. For this stretch, bend slightly forward and take a single step. You should land on your heel, and you should roll from heel to the ball of your foot while still bending forward slightly. Then repeat for the other leg. The goal here is to loosen up your calves, which often retain a lot of tension during and after leg-heavy exercises.

Post-bicycling stretches

Hamstring stretch: Your hamstrings do a lot of work when you’re cycling. So, once you’re done, take a little time to stretch them out. First, while you’re standing still, bend over and lower your arms down to the floor. If you need to, let your knees bend slightly. Breathe steadily and deeply, and gradually lower your hands to the floor.

Shoulders: Believe it or not, remaining hunched over your handlebars for a long stretch of time can cause tension to build up in your shoulders and neck. When you get home, roll your head in a circle for 30 seconds or so, and follow that up with raising your shoulders up and down for a few seconds.

Core: Lastly, your core does quite a bit of work while you’re riding. If there’s one muscle group that helps you to retain balance, it’s your core muscles—so make sure to stretch them out! Also, these muscles support you while you’re leaning forward and riding low. So, once you’re done with your ride, head back home and do a few crunches, back extensions or yoga poses (like cat/cow or down dog/up dog) to help stretch out your core and back muscles. It’ll definitely help!