Tidied and use a real counter