Added visit counter
Replaced with code from stay focused