count up or down depending on switches