rewrote count inputs