Added visits log functionality
Some clean-up
A little bugfix