work on counter (doesn't work)
tidy up counter
stack overflow resolved