AVR Button Interfacing
Debouncing is something you must be familiar with when using buttons. When a contact closes, it does not just close, but bounces back a few times until it finally settles in its closed position.

Depending on how fast your sampling code is, the code can count many button presses, although you only moved your finger once. There are a number of debouncing strategies around. Search www.avrfreaks.net for debouncing and you will find plenty of posts. Most of the recent threads contain a link to some pretty good old examples/strategies which you can use.

This might not be the only problem with your code - but we can only know that when we've seen the code. Post it here or on avrfreaks and we might be able to help you.