It looked like the Miami Dolphins used the week leading up to the game against the Buffalo Bills wisely. The 3-2 team, which had lost the last two games before its bye week, looked like a franchise that worked on its running game and its defense showed it was healed and improved from injuries that had failed it in the previous few weeks.

The Buffalo Bills had other ideas when it came to a return to Sun Life Stadium in south Florida.

Thad Lewis, still playing in replace of starter EJ Manuel brought his team back from a 14-point deficit as the Bills won in Miami 23-21 on Sunday.

According to ESPN.com, “Mario Williams forced a fumble by sacking Ryan Tannehill with less than three minutes to go, setting up the winning 31-yard kick by Dan Carpenter, who was released in August after five seasons with the Dolphins.”

Miami knew coming into the contest it needed to be more aggressive on defense and use a running game that had not made any noise this season to keep Buffalo’s defense off balance. In the end, Lewis, a former practice squad player, led the Bills to a huge AFC East win.

Here are fine things we learned from Sunday’s action.

Lewis was efficient

He completed 21 of 32 passes for 178 yards. He did not have to win this game for his team (although he did) - all he had to do was manage it. Lewis looked calm under pressure at times, and in control of the game.

"I was excited," he said. "I'm not a rah-rah guy, but when you're down and out, you've got to do something to get the team going,” said on ESPN.com of the win for his team.

Tannehill showed weakness at times

The second-year quarterback still has room to grow, Along with his fumble and interception returned for a touchdown, Tannehill threw another interception when Miami was threatening to score. The Texas A&M product came into the game on pace to set an NFL record for being sacked and increased his total to 26 with two -- both by Mario Williams, who now has 10 this year.

Running to daylight

The Dolphins decided to start Daniel Thomas instead of Lamar Miller. While I did not think it was a good move at first, it proved to be a string move by offensive coordinator Mike Sherman. Thomas finished with 60 yards on 12 carries. Miller had 43 yards on nine carries. The running game seemed to be more aggressive and the team averaged 4.8 yards per carry per game. May there was a statement made on Sunday.

Buffalo’s defense came to the rescue

Rookie Nickell Robey returned an interception 19 yards for a touchdown on the third play of the game, and Buffalo turned the tide late with the help of two sacks by Mario Williams. The Bills defense showed great strength in stopping Miami when it had to. The Dolphins used a more improved rushing game on Sunday, but the bend but don’t break Bills did not allow the offense to dominate the game.

New England awaits

Now that the Dolphins are even on the season, a New England team that lost to the Jets awaits this team. Tom Brady has been hot and cold this season. The Dolphins secondary will be one more week healed from injuries. How will Tannehill recover from the loss this week and deal with the Patriots fast defensive ends? Can the Dolphins make a statement in the division against the perennial favorite?