Throughout this level, you’ll find many cogs that spin both clockwise and counterclockwise. You need to pay attention which direction they spin, because you could wind up falling into a pit by running too fast in one direction.
Start by crossing the first two cogs, then drop down near the big one. Defeat the Mega Piranha Plant and grab the power-up (Boomerang Flower) from the ?-Block. You can get back up by riding one of the teeth of the larger cogs. There will be another Mega Piranha Plant here, as well as two more large cogs. You will get on the higher cog, on the left side, so ride it up and toss a boomerang out to collect Green Star #1 in the air. Continue to the right, past some more large cogs, then use the pipe at the end to travel to the Checkpoint Flag.
You will be at the base of a large wall, with a bunch of large cogs, some of which will have Piranha Plants on them. So, you will need to use these cogs to scale the wall, with two Mega Piranha Plants waiting for you at the top. You can either take them out, or just bypass them and jump into the clear pipe. This will take you to a new area, where you see a bunch of Horned Ant Troopers coming out of an opening. One of them is carrying a Boomerang Flower, so grab it if you need it. Otherwise, defeat the Ant Troopers and drop down into the hole to find the Stamp.
As you continue to the right, you will encounter a lot more Horned Ant Troopers, two sets this time. Get rid of some and drop down into the hole here to find a Mystery Box. The bonus area has you running on a cog, while dodging some Piranha Plants. When you see two Plants right next to each other, Green Star #2 will be right behind them. Back in the main level, make it to the end and take the pipe to the Goal Pole area. The catch, though, as you might guess is to avoid the Goal Pole and go past it. There is a large island in the distance you can long jump to, where you need to catch a rabbit to snag Green Star #3. Grab the clock pickup, then jump in the pipe to return to the Goal Pole.