Added logic to accept one button push for 'on' state and second button push for 'off' state