Redo how visits are calculated - issue 19