thanks cawhiteley... and grumpy_mike i do have external resistors and the buttons work just fine independently.. sorry but could please tell me the exact coding part of whats wrong and the right code.. coz i don't understand what you mean when you're saying im reading the button and not the state..