Cleaned up isButtonPressed()