added a simple counter for inputs