Adding a simple up/down counter whose direction is controlled by an input switch